package my;

import android.content.Context;
import android.location.Location;
import android.widget.Toast;

import com.google.android.maps.GeoPoint;

public class Utils {

	public static Location locationFromGeoPoint(GeoPoint point){
		Location newLocation = new Location("");
		newLocation.setLatitude((double)(point.getLatitudeE6()/1000000.0));
		newLocation.setLongitude((double)(point.getLongitudeE6()/1000000.0));
		return newLocation;
	}
	
	public static GeoPoint geoPointFromLocation(Location newLocation){
		return new GeoPoint((int)(newLocation.getLatitude()*1E6), (int)(newLocation.getLongitude()*1E6));
	}
	
	public static void showToast(Context context, String text,int length){
		Toast toast = Toast.makeText(context, text, length);
		toast.show();
	}
	
}
